<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
	</body>
</html>

<script type="text/javascript">
	const obj1 = {
		username: 'zs',
		age: 18,
		o: {x: 100}
	}
	
	// 使obj2 拥有所有obj1 的属性,属于浅拷贝
	const obj2 = {
		...obj1,
		addr: '深圳',
		age: 28
	}
	console.log(obj2);
	obj2.username = 'ls';
	console.log(obj1.username); // zs
	
	obj2.o.x = 200;
	console.log(obj1.o.x); // 200
	
	
	
</script>
